﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebUI.Repositorys;

namespace WebUI.Services
{
    public class UserService:Repository<string>
    {
        private IConfiguration _configuration;
        private readonly IHttpContextAccessor _httpContextAccessor;
        public UserService(IConfiguration configuration, IHttpContextAccessor httpContextAccessor)
        {
            _configuration = configuration;
            _httpContextAccessor = httpContextAccessor;
        }

        public void Test()
        {
            string he = _configuration.GetSection("Logging:LogLevel:Default").Value;
            ILoggerFactory factory= _httpContextAccessor.HttpContext.RequestServices.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
            factory.CreateLogger("hel").LogDebug("ggg");
        }
        
    }
}
